import json
from datetime import datetime, timedelta


def main(args):
    date_obj = datetime.now()
    week_start = 1
    # 找到本周的起始日
    start_current_week = date_obj - timedelta(days=(date_obj.weekday() + 1 + (7 - week_start)) % 7)
    end_current_week = start_current_week + timedelta(days=6)
    # 找到本周星期转换日期
    current_Mon = start_current_week
    current_Tue = start_current_week + timedelta(days=1)
    current_Wed = start_current_week + timedelta(days=2)
    current_Thu = start_current_week + timedelta(days=3)
    current_Fri = start_current_week + timedelta(days=4)
    current_Sat = start_current_week + timedelta(days=5)
    current_Sun = start_current_week + timedelta(days=6)

    # 计算上周范围
    start_last_week = start_current_week - timedelta(weeks=1)
    end_last_week = start_last_week + timedelta(days=6)

    # 计算本月范围
    start_current_month = date_obj.replace(day=1)
    if date_obj.month == 12:
        end_current_month = date_obj.replace(year=date_obj.year + 1, month=1, day=1) - timedelta(days=1)
    else:
        end_current_month = date_obj.replace(month=date_obj.month + 1, day=1) - timedelta(days=1)

    # 计算上月范围
    if date_obj.month == 1:
        start_last_month = date_obj.replace(year=date_obj.year - 1, month=12, day=1)
        end_last_month = date_obj.replace(day=1) - timedelta(days=1)
    else:
        start_last_month = date_obj.replace(month=date_obj.month - 1, day=1)
        end_last_month = date_obj.replace(day=1) - timedelta(days=1)

    # 即将到期日
    due_date = date_obj + timedelta(days=30)
    return {
        "now_date": date_obj.strftime('%Y-%m-%d'),
        "due_date": due_date.strftime('%Y-%m-%d'),
        "current_Mon": current_Mon.strftime('%Y-%m-%d'),
        "current_Tue": current_Tue.strftime('%Y-%m-%d'),
        "current_Wed": current_Wed.strftime('%Y-%m-%d'),
        "current_Thur": current_Thu.strftime('%Y-%m-%d'),
        "current_Fri": current_Fri.strftime('%Y-%m-%d'),
        "current_Sat": current_Sat.strftime('%Y-%m-%d'),
        "current_Sun": current_Sun.strftime('%Y-%m-%d'),
        "start_current_week": start_current_week.date().strftime('%Y-%m-%d'),
        "end_current_week": end_current_week.date().strftime('%Y-%m-%d'),
        "start_last_week": start_last_week.date().strftime('%Y-%m-%d'),
        "end_last_week": end_last_week.date().strftime('%Y-%m-%d'),
        "start_current_month": start_current_month.date().strftime('%Y-%m-%d'),
        "end_current_month": end_current_month.date().strftime('%Y-%m-%d'),
        "start_last_month": start_last_month.date().strftime('%Y-%m-%d'),
        "end_last_month": end_last_month.date().strftime('%Y-%m-%d')
    }

print(main(""))